home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
pctj8410.arc
/
MOUSE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-09-14
|
1KB
|
52 lines
{ MOUSKETCH }
{ by Jeff Duntemann }
PROGRAM MOUSKETCH;
TYPE REGPACK = RECORD
AX,BX,CX,DX,BP,SI,DI,DS,ES,FLAGS : INTEGER
END;
VAR OLDX,OLDY,X,Y : INTEGER;
M1,M2,M3,M4 : INTEGER;
REGSET : REGPACK;
PROCEDURE MOUSE(VAR M1,M2,M3,M4 : INTEGER);
VAR REGSET : REGPACK;
BEGIN
WITH REGSET DO
BEGIN { Set up AX/BX/CX/DX for interrupt }
AX := M1;
BX := M2;
CX := M3;
DX := M4
END;
INTR(51,REGSET); { Trip interrupt 51 }
WITH REGSET DO
BEGIN { Put return values back into M1-M4 }
M1 := AX;
M2 := BX;
M3 := CX;
M4 := DX
END
END;
BEGIN
HIRES; { Choose graphics mode & color }
HIRESCOLOR(YELLOW);
M1:=0; { Init mouse driver }
MOUSE(M1,M2,M3,M4);
M1:=1; { Turn mouse cursor on }
MOUSE(M1,M2,M3,M4);
M1 := 3; OLDX := 0; OLDY := 0;
WHILE NOT KEYPRESSED DO { Exit MOUSKETCH when any key pressed }
BEGIN
MOUSE(M1,M2,M3,M4);
IF M2 <> 0 THEN DRAW(OLDX,OLDY,M3,M4,1); { Draw if button pressed }
OLDX := M3; { Update old X/Y values }
OLDY := M4;
END;
END.